package com.zxsj.fdk.study.service.check;

import com.zxsj.fdk.study.common.validation.Phone;
import com.zxsj.fdk.study.common.validation.condition.CreateAction;
import com.zxsj.fdk.study.common.validation.condition.UpdateAction;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @Description 测试校验注解
 * @Author mengweibin
 * @Date 2021-07-11 19:39
 */
@Data
@ApiModel("测试入参 - ")
public class TestCheckParam {
    @NotNull
    @ApiModelProperty("商户id")
    private Long merchantId;

//    @NotBlank(groups = UpdateAction.class)
    @NotBlank
    @ApiModelProperty("一个不能为空的入参")
    private String notBlank;

    @DecimalMin(value = "0", message = "最小不能小于0", groups = CreateAction.class)
    private BigDecimal minZero;

    @Max(value = 66, message = "最大不能超过66")
    private Long max66;

    @ApiModelProperty("姓名")
    @NotEmpty(groups = CreateAction.class, message = "姓名不能为空！")
    private String userName;

    @ApiModelProperty("年龄")
    @Min(groups = CreateAction.class, value = 0)
    private Integer age;

    @Past
    @ApiModelProperty("付款时间")
    private LocalDateTime payTime;

    @Future
    @ApiModelProperty("预计发货时间")
    private LocalDateTime deliverTime;


    @ApiModelProperty("手机号 - 测试")
    @Phone
    private String phone;

}
